n = int(input())
k = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())
a.sort()
a.append(1000000)
group_start = 0
ansPairs = ansSum = 0
for i in range(1, len(a)):
    if a[i] - a[i - 1] > k:
        ansPairs += (i - group_start) // 2
        if (i - group_start) % 2 != 0:
            ansSum += a[group_start]
        group_start = i
print(ansPairs, ansSum, sep='\n')
